import Vue from 'vue'
import App from './App'
import Router from 'vue-router'
import Layout from './components/Layout'
import CustomerIndex from './components/customer/CustomerIndex'
import CustomerList from './components/customer/CustomerList'
import Quotation from './components/customer/Quotation'
import axios from 'axios'
import $ from 'jquery'
import MarketingIndex from './components/marketing/MarketingIndex'
import Planing from './components/marketing/Planing'

import EmailIndex from './components/email/EmailIndex'
import EmailEdit from './components/email/EmailEdit'
import EmailInbox from './components/email/EmailInbox'
import Senderbox from './components/email/Senderbox'

import { quillEditor } from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'


import './assets/icon/iconfont.css'
import { Button,
	Select,
	Menu,
	Input,
	Submenu,
	MenuItem,
	MenuItemGroup,
	Radio,
	RadioGroup,
	RadioButton,
	Tooltip,
	Popover,
	Row,
	Col,
	Option,
	Rate,
	DatePicker,
	Dialog,
	MessageBox,
	Form,
	FormItem,
	Loading,
	Message,
	Autocomplete,
	Tag,
	Upload,
	Pagination} from 'element-ui';
Vue.config.productionTip = false
Vue.use(Button);
Vue.use(Menu);
Vue.use(Input);
Vue.use(Submenu);
Vue.use(MenuItem);
Vue.use(MenuItemGroup);
Vue.use(Select);
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(RadioButton);
Vue.use(Tooltip);
Vue.use(Router);
Vue.use(Popover);
Vue.use(Row);
Vue.use(Col);
Vue.use(Option);
Vue.use(Rate);
Vue.use(DatePicker);
Vue.use(Dialog);
Vue.use(Form);
Vue.use(FormItem);
Vue.use(Loading);
Vue.use(Autocomplete);
Vue.use(Tag);
Vue.use(Upload);
Vue.use(Pagination);
Vue.use(Loading.directive);

Vue.prototype.$ajax = axios;
Vue.prototype.$loading = Loading.service;
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$notify = Notification;
Vue.prototype.$message = Message;
/* eslint-disable no-new */
var router = new Router({
	routes:[
		{
			path:"/",
			name:"layout",
			component:Layout,
			children:[
				{
					path:"customer",
					component:CustomerIndex,
					children:[
						{
							path:"customerlist",
							component:CustomerList,
						},
						{
							path:"quotation",
							component:Quotation
						}
					]
				},
				{
					path:"marketing",
					component:MarketingIndex,
					children:[
						{
							path:"planing",
							component:Planing,
						},
					]
				},
				{
					path:"email",
					component:EmailIndex,
					children:[
						{
							name:'edit',
							path:"edit",
							component:EmailEdit,
						},
						{
							name:'inbox',
							path:"inbox",
							component:EmailInbox,
						},
						{
							name:'senderbox',
							path:'senderbox',
							component:Senderbox
						}
					]
				}
			]
		}
	]
})
// var resp = $.ajax({url:"/user/get",dataType:"json",async:false});
// resp = JSON.parse(resp.responseText);
// Vue.prototype.$user= resp.user;
Vue.prototype.$user = {
	email:"550558263@qq.com",
	company:"CRM开发有限公司",
	name:"fjx",
	mobile:"13516609672"
}
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
